package com.botann.projects.model;

import javax.persistence.*;

/**
 * cs_erp
 * RoleMenu
 * Created by 刘山国 on 2018/9/28.
 * Copyright (c) 2017 伯坦科技. All rights reserved
 */
@Entity
@Table(name = "role_menu", schema = "db_cs_erp", catalog = "")
public class RoleMenu {
    private int id;
    private int roleId;
    private int menuId;

    public RoleMenu() {
    }

    public RoleMenu(int id, int roleId, int menuId) {
        this.id = id;
        this.roleId = roleId;
        this.menuId = menuId;
    }

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "role_id", nullable = false)
    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        this.roleId = roleId;
    }

    @Basic
    @Column(name = "menu_id", nullable = false)
    public int getMenuId() {
        return menuId;
    }

    public void setMenuId(int menuId) {
        this.menuId = menuId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RoleMenu roleMenu = (RoleMenu) o;

        if (id != roleMenu.id) return false;
        if (roleId != roleMenu.roleId) return false;
        if (menuId != roleMenu.menuId) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + roleId;
        result = 31 * result + menuId;
        return result;
    }
}
